package com.ruoyi.product.service.impl;

import java.util.List;

import com.ruoyi.product.domain.vo.RecommendVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.product.mapper.RecommendMapper;
import com.ruoyi.product.domain.Recommend;
import com.ruoyi.product.service.IRecommendService;

/**
 * 推荐商品Service业务层处理
 *
 * @author jtm
 * @date 2024-12-07
 */
@Service
public class RecommendServiceImpl implements IRecommendService
{
    @Autowired
    private RecommendMapper recommendMapper;

    /**
     * 查询推荐商品
     *
     * @param id 推荐商品主键
     * @return 推荐商品
     */
    @Override
    public Recommend selectRecommendById(Long id)
    {
        return recommendMapper.selectRecommendById(id);
    }

    @Override
    public Recommend selectRecommendByProId(Long pId) {
        return recommendMapper.selectRecommendByProId(pId);
    }

    /**
     * 查询推荐商品列表
     *
     * @param recommend 推荐商品
     * @return 推荐商品
     */
    @Override
    public List<Recommend> selectRecommendList(Recommend recommend)
    {
        return recommendMapper.selectRecommendList(recommend);
    }

    @Override
    public List<RecommendVo> selectRecList(RecommendVo recommendVo) {
        return recommendMapper.selectRecList(recommendVo);
    }

    @Override
    public List<RecommendVo> selectUserRecList(RecommendVo recommendVo) {
        return recommendMapper.selectUserRecList(recommendVo);
    }

    /**
     * 新增推荐商品
     *
     * @param recommend 推荐商品
     * @return 结果
     */
    @Override
    public int insertRecommend(Recommend recommend)
    {
        return recommendMapper.insertRecommend(recommend);
    }

    /**
     * 修改推荐商品
     *
     * @param recommend 推荐商品
     * @return 结果
     */
    @Override
    public int updateRecommend(Recommend recommend)
    {
        return recommendMapper.updateRecommend(recommend);
    }

    /**
     * 批量删除推荐商品
     *
     * @param ids 需要删除的推荐商品主键
     * @return 结果
     */
    @Override
    public int deleteRecommendByIds(Long[] ids)
    {
        return recommendMapper.deleteRecommendByIds(ids);
    }

    /**
     * 删除推荐商品信息
     *
     * @param id 推荐商品主键
     * @return 结果
     */
    @Override
    public int deleteRecommendById(Long id)
    {
        return recommendMapper.deleteRecommendById(id);
    }
}
